

/*--------------------------------------------------------------
  2. 页面初始化，计算rem
--------------------------------------------------------------*/
// 函数立即调用
(function () {
    //页面初始化，针对屏幕不是1920*1080的页面尺寸
    const buildRem = function () {
      let designSize = 1920; // 设计图尺寸            
      let html = document.documentElement;
      let wW = html.clientWidth;// 窗口宽度
      let rem = wW * 100 / designSize;
      html.style.fontSize = rem + 'px';
    }
    buildRem()
    // 页面缩放时 font-size 的调整
    window.onresize = buildRem;
    /* 
    1920                 100
    ----------    =   -----------
    你的宽（wW）        你的字体大小
  */
  })();
 

  
  // 回到顶部
 (function () {
  let up = document.querySelector('#up')
  const html = document.documentElement

  document.addEventListener('scroll', function () {
      up.hidden = !(html.scrollTop > html.clientHeight)
  }, false);


  up.addEventListener('click', function () {
      html.scrollTo({
          top: 0,
          behavior: "smooth"
      })
  }, false)
})()


const base_url = 'http://81.70.162.221:3000'
axios.defaults.baseURL = base_url

function imgUrl(url) {
  return base_url + '/' + url
}
function GetQueryString(name) {
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(reg);
  if (r != null) return unescape(r[2]); return null;
}


